package com.weichat.jwh.tool;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component

public class Timetool {
	@Autowired
	MessageTool messageTool;
	public final static long ONE_Minute =  60 * 1000;

	  @Scheduled(cron="0 30 7 ? * 1,3,5,6,7")
	    public void eoringWeakUp() throws IOException{
	       messageTool.doSendMsg("到期提醒","起床" ,"7:30",1);
	       messageTool.doSendMsg2("到期提醒","起床" ,"7:30",1);
	    }
	  @Scheduled(cron="0 49 7 ? * 1,3,5,6,7")
	  public void eatBreakfast() throws IOException{
		  messageTool.doSendMsg("到期提醒","吃早餐" ,"7:49" ,2);
		  messageTool.doSendMsg2("到期提醒","吃早餐" ,"7:49" ,2);
	  }
	  @Scheduled(cron="0 31 8 ? * 1,3,5,6,7")
	  public void sitBenz() throws IOException{
		  messageTool.doSendMsg("到期提醒","乘营车" ,"8:31" ,3);
		  messageTool.doSendMsg2("到期提醒","乘营车" ,"8:31" ,3);
	  }
	  @Scheduled(cron="0 0 9 ? * 1,3,5,6,7")
	  public void moringSetPhone() throws IOException{
		  messageTool.doSendMsg("到期提醒","早上放手机" ,"9:00",4 );
		  messageTool.doSendMsg2("到期提醒","早上放手机" ,"9:00",4 );
	  }
	  @Scheduled(cron="0 20 13 ? * 1,3,5,6,7")
	  public void noonBreak() throws IOException{
		  messageTool.doSendMsg("到期提醒","午休" ,"13:20" ,5);
		  messageTool.doSendMsg2("到期提醒","午休" ,"13:20" ,5);
	  }
	  @Scheduled(cron="0 0 14 ? * 1,3,5,6,7")
	  public void noonBreakUp() throws IOException{
		  messageTool.doSendMsg("到期提醒","午休起床" ,"14:00",6 );
		  messageTool.doSendMsg2("到期提醒","午休起床" ,"14:00",6 );
	  }
	  @Scheduled(cron="0 15 14 ? * 1,3,5,6,7")
	  public void noonSetPhone() throws IOException{
		  messageTool.doSendMsg("到期提醒","下午放手机" ,"14:15",7 );
		  messageTool.doSendMsg2("到期提醒","下午放手机" ,"14:15",7 );
	  }
	  @Scheduled(cron="0 45 18 ? * 1,3,5,6,7")
	  public void exercise() throws IOException{
		  messageTool.doSendMsg("到期提醒","每日运动", "18:45",8 );
		  messageTool.doSendMsg2("到期提醒","每日运动", "18:45",8 );
	  }
	  @Scheduled(cron="0 08 22 ? * 1,3,5,6,7")
	  public void nightSetPhone() throws IOException{
		//  messageTool.doSendMsg("到期提醒","晚上放手机" ,"20:10" ,11);
		  messageTool.doSendMsg2("到期提醒","晚上放手机" ,"20:10" ,11);
	  }
	  @Scheduled(cron="0 50 23 ? * 1,3,5,6,7")
	  public void nightSleep() throws IOException{
		  messageTool.doSendMsg("到期提醒","晚上睡觉" ,"23:50" ,12);
		  messageTool.doSendMsg2("到期提醒","晚上睡觉" ,"23:50" ,12);
	  }
	  
	  /* @Scheduled(cron="* * * ? * 1,3,5,6,7")
	  public void test1() throws IOException{
		  messageTool.doSendMsg("test","晚上睡觉" ,"23:50" ,12);
	  }
	 
	  @Scheduled(cron="0 0 20 ? * 1,3,5,6,7")
	  public void test2() throws IOException{
		  messageTool.doSendMsg("test","晚上睡觉" ,"23:50" ,12);
	  }
	  @Scheduled(cron="0 30 20 ? * 1,3,5,6,7")
	  public void test3() throws IOException{
		  messageTool.doSendMsg("test","晚上睡觉" ,"23:50" ,12);
	  }
	  @Scheduled(cron="0 30 20 ? * 1,3,5,6,7")
	  public void test4() throws IOException{
		  messageTool.doSendMsg("test","晚上睡觉" ,"23:50" ,12);
	  }*/
	/* @Scheduled(cron="* * * ? * *")
	    public void cronJob2() throws IOException{
		  messageTool.doSendMsg("test","每日运动", "18:45",8 );	}
	*/

	
/*    @Scheduled(cron="0 0 20 ? * *")
    public void fixedDelayJob(){
        System.out.println(send.sendMsg("onw4I1Bv1GLEQpnoBVYKPyEIBgWk", "8:00", "8:00"));
    }

    @Scheduled(cron="0 22 20 ? * *")
    public void fixedRateJob(){
        System.out.println(send.sendMsg("onw4I1Bv1GLEQpnoBVYKPyEIBgWk", "8:30", "8:30"));
    }

    @Scheduled(cron="0 0 21 ? * *")
    public void cronJob1(){
        System.out.println(send.sendMsg("onw4I1Bv1GLEQpnoBVYKPyEIBgWk", "9:00", "9:00"));
    }*/

   /* @Scheduled(cron="* * * ? * *")
    public void cronJob2(){
        System.out.println(send.sendMsg2("onw4I1FtxoRi6E0hZojjrZappwxQ", "9:00", "9:00"));
    }
*/

}
